//
//  JXBaseTableViewController.swift
//  weibo
//
//  Created by admin on 16/5/21.
//  Copyright © 2016年 admin. All rights reserved.
//

import UIKit

class JXBaseTableViewController: UITableViewController, JXVisitorViewDelegate {

	override func viewDidLoad() {
		super.viewDidLoad()

		visitorView.visitorDelegate = self
	}

	// MARK:重写loadView方法,用户登录时显示登录后界面(tableView),否则显示访客视图
	let userLogin = JXUserAccountViewModel.shareUserAccount.userLogin

//    print("date:\(date)")

	// MARK:添加访客视图属性
	lazy var visitorView: JXVisitorView = JXVisitorView()

	override func loadView() {

		if (userLogin == false) {

            self.loadVisitorView()


		} else {

            super.loadView()

		}

	}

	// 加载访客视图
	private func loadVisitorView() {

		let v = visitorView

		view = v

	}

//MARK:实现代理方法,登录,注册

	func willLogin() {

		let loginController = UINavigationController(rootViewController: JXLoginViewController())

		presentViewController(loginController, animated: true, completion: nil)

	}

	func willRegister() {

		print("注册")

	}

}
